<?php
!defined('P_W') && exit('Forbidden');
define('AREA_SCR', 'image_xml');
InitGP(array('id'), '', 2);

$imageService = House::loadClass('houseimage'); /* @var $imageService PW_HouseImage */
$image = $imageService->getImage($id);

$basename = $houseBaseUrl.'q=album&hid=' . $image['hid'];

$typeid = $image['typeid'];
$hid = $image['hid'];
if (!$image)
	Showmsg('undefined_action');

$houseService = house::loadClass('house');/* @var $houseService PW_House */
$houseService->setHid($hid);

if (!$houseService->init(true)) {
	Showmsg('该相册所在楼盘不存在或已被删除!');
}
$houseService->setNav();
$houseService->setBanner();
$houseinfo = & $houseService->info;

$imageTypeService = House::loadClass('houseimagetype'); /* @var $imageTypeService PW_HouseImageType */
$imageType = $imageTypeService->getType($typeid);
if (!$imageType)
	Showmsg('undefined_action');
$topid = $imageType['sub'] ? (int) $imageType['sub'] : $typeid;

$topTypes = $imageTypeService->getTopTypes();

$typeRoute = $topTypes[$topid]['name'];
if ($topid == $typeid && !$other) {
	$typeRoute .= '全部';
} elseif ($topid == $typeid && $other) {
	$typeRoute .= '其他';
} else {
	$typeRoute .= $imageType['name'];
}
$imageUrl = urlencode($db_bbsurl . '/'.$houseBaseUrl.'q=image_xml&id=' . $id);

require_once (M_P . 'require/header.php');
require_once PrintEot('image');
?>